Skip to content

Feature - Reformatting for linting, format and analysis with Mago - #174

Draft
simon-mundy wants to merge 6 commits into
php-db:0.6.xfrom
simon-mundy:qa/feature-src
Draft

Feature - Reformatting for linting, format and analysis with Mago#174
simon-mundy wants to merge 6 commits into
php-db:0.6.xfrom
simon-mundy:qa/feature-src

Conversation

@simon-mundy

Copy link
Copy Markdown
Member

Feature component QA pass, split into two commits for review:

  • Annotate Feature classes and types — annotation-only, no runtime change
  • Guard nullable state in the TableGateway features — behavioural guards and refactors

Analyzer 149 → 5, lint 18 → 2 across src/Feature, src/RowGateway/Feature and src/TableGateway/Feature. src/Adapter/Driver/Feature is excluded (Adapter is parked).

Replaces #173, which was opened from the wrong head repository.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

- Add @api to the Feature interfaces, both AbstractFeature bases,
  EventFeatureEventsInterface, EventFeature, GlobalAdapterFeature,
  MetadataFeature, SequenceFeature and TableGateway\Feature\FeatureSet
- Mark RowGatewayFeature, MasterSlaveFeature and TableGatewayEvent final
- Type the EventFeatureEventsInterface constants and both APPLY_HALT
- Add array shape docblocks to the FeatureSets, AbstractFeature::$sharedData,
  RowGatewayFeature::$constructorArguments and TableGatewayEvent::$params
- Declare TableGatewayEvent as an EventInterface implementation
- Correct AbstractTableGateway's @Property $table to the declared union and
  narrow TableGateway::__construct's $features docblock
- Register the AbstractFeature gateway setters as class initializers
- Drop the Feature entries from the analysis baselines
- Make EventFeature::$event non-nullable and assign it explicitly
- Resolve GlobalAdapterFeature::getStaticAdapter through a coalesce chain
  and throw when no adapter is registered
- Make MasterSlaveFeature::$masterSql nullable and throw when the gateway
  has no Sql instance or postInitialize has not run
- Throw in SequenceFeature when a statement yields no result, when the
  sequence returns no usable value and when an insert exposes no arrays
- Interpolate the SequenceFeature sequence statements and search insert
  columns strictly
- Resolve the MetadataFeature table through getTable(), throw when it is
  not a named table, and take the primary key with reset()
- Extract RowGatewayFeature::primaryKeyFromMetadata(), flatten the
  prototype branches and throw when the gateway has no named table
- Replace the deprecated setArrayObjectPrototype() calls with
  setRowPrototype()
- Convert the Feature test methods to #[Test] attributes
- Use static:: assertions and strict comparisons throughout
- Hoist mock assignments out of the EventFeature call arguments
- Assert the MetadataFeature shared data by key rather than isset()
- Rename the TestTableGatewayFeature dispatch target to recordCall()
- Drop the Feature test entries from the lint baseline
- Test the MasterSlaveFeature Sql guards in postInitialize and postSelect
- Test the SequenceFeature result, sequence value and raw state guards
- Test the MetadataFeature named table guard and non-primary-key constraints
- Test the RowGatewayFeature table, feature set and primary key guards
- Test getFeatureByClassName skipping features of another class
- Point the RowGatewayFeature tests at the RowPrototypeResultSet helper
- Restore the AbstractTableGateway and Feature class size baseline entries
  dropped when the baselines were regenerated upstream
- Resolve the RowGatewayFeature metadata feature through a nullsafe call
- Tag the SequenceFeature platform TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant